/*
*Copyright (c) Nikhil Jain.
*Project ICARUS, communications and 
*artificial intelligence.
*/



/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package javadrone.client.access;

//~--- non-JDK imports --------------------------------------------------------

import javadrone.RemoteImage;

//~--- JDK imports ------------------------------------------------------------

import java.util.concurrent.ArrayBlockingQueue;

/**
 *
 * @author Nikzzay
 */
public class ImageProducer extends ArrayBlockingQueue<RemoteImage> implements ImageQueue {
    public ImageProducer(int size) {
        super(size);
    }

    @Override
    public boolean add(RemoteImage ri) {
        if (remainingCapacity() <= 0) {
            remove();
        }

        return super.add(ri);
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
